package com.xzgj.fmmall.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Id;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "ProductSku对象",description = "商品套餐信息")
public class ProductSku {
    @ApiModelProperty(dataType = "sku_id",value = "套餐id",required = false)
    private static final long serialVersionUID = 1L;
    /**
     * 问题：使用Mybatis中Mapper内置方法updateByPrimaryKeySelective更新失败。
     *
     * 发现：控制台打印出来的sql语句发现where条件出现所有属性---实际情况是调用方法后，库存未成功更新。使用@Id后解决
     *
     * 解决：映射的实体类没有标明主键，在实体类的主键上标明（使用@Id）
     */
    @Id
    private Integer sku_id;
    @ApiModelProperty(dataType = "product_id",required = true,value = "商品id")
    private String product_id;
    @ApiModelProperty(dataType = "sku_name",required = true,value = "sku名称")
    private String sku_name;
    @ApiModelProperty(dataType = "sku_img",required = true,value = "sku图片")
    private String sku_img;
    @ApiModelProperty(dataType = "untitled",required = true,value = "套餐组合")
    private String untitled;
    @ApiModelProperty(dataType = "original_price",required = true,value = "原价")
    private String original_price;
    @ApiModelProperty(dataType = "sell_price",required = true,value = "售价")
    private String sell_price;
    @ApiModelProperty(dataType = "discounts",required = true,value = "折扣力度")
    private String discounts;
    @ApiModelProperty(dataType = "stock",required = true,value = "库存")
    private String stock;
    @ApiModelProperty(dataType = "status",required = true,value = "商品状态")
    private String status;
    @ApiModelProperty(dataType = "create_time",required = true,value = "注册时间")
    private Date create_time;
    @ApiModelProperty(dataType = "update_time",required = true,value = "更新时间")
    private Date update_time;
}
